<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改接口管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-inter-edit" th:object="${baseInter}">
            <input name="idInter" th:field="*{idInter}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="na" th:field="*{na}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">分类：</label>
                <div class="col-sm-8">
                    <select name="euClass" class="form-control m-b">
                        <option value="outer" th:selected="*{euClass} eq 'outer' ">外部</option>
                        <option value="ods"  th:selected="*{euClass} eq 'ods' ">ODS</option>
                        <option value="dw"  th:selected="*{euClass} eq 'dw' ">DW</option>
                        <option value="dm"  th:selected="*{euClass} eq 'dm' ">DM</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">SQL：</label>
                <div class="col-sm-8">
                    <textarea name="sqlQry" class="form-control" rows="10">[[*{sqlQry}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据源：</label>
                <div class="col-sm-8">
                    <select name="idDb" class="form-control m-b" th:with="type=${@baseDbService.selectAll()}">
                        <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.idDb}" th:selected="*{idDb} eq ${item.idDb} "></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="des" class="form-control">[[*{des}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/base/inter";
        $("#form-inter-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-inter-edit').serialize());
            }
        }
    </script>
</body>
</html>